מבוא למדעי המחשב עבודה # 3

Size: px
Start display at page:

Download "מבוא למדעי המחשב עבודה # 3"

Transcription

1 מבוא למדעי המחשב עבודה # 3 תרגיל זה עוסק ברקורסיות ובתכנות מונחה עצמים. הוראות כלליות לעבודה: ניתן ומומלץ להגיש את העבודה בזוגות. כל איחור בהגשת התרגיל יגרום להורדת ציון, כפי שהוגדר בנהלים שבאתר הקורס..1.2 תרגיל אותו לא ניתן להדר )לקמפל( או להריץ, יקבל ציון נכשל..3 העבודה תבדק באופן אוטומטי לפי הפלט אשר התוכניות שלכם ידפיסו למסך. לכן יש להקפיד על ההוראות ולבצע אותן במדויק.כל הדפסה אשר אינה עונה באופן מדויק לדרישות המופיעות בעבודה עלולה לגרום לתוכנית הבדיקה האוטומטית להיכשל. סגנון כתיבת הקוד יבדק באופן ידני. יש להקפיד על כתיבת קוד ברור, מתן שמות משמעותיים למשתנים, הזחות והוספת הערות בקוד המסבירות את תפקידם של מקטעי קוד שונים..4.5 כתיבת קוד אשר אינו עומד בסטנדרטים אלו תגרור הפחתה בציון העבודה. במידה ואינכם בטוחים מהו הפרוש המדויק להוראה מסוימת, או בכל שאלה אחרת הקשורה בתוכן העבודה, אנא העזרו בפורום. בכל בעיה אישית הקשורה לעבודה )מילואים, אישפוז וכו'(, אנא צרו את הפניה המתאימה ב- System Submission כפי שמוסבר בסילבוס שבאתר הקורס. לעבודה מצורפים שלושה קבצים example.java,painter.java ו-.Main.java הקובץ Painter.java מספק לכם ממשק גרפי שיעזור לכם לבדוק את הקוד שתכתבו על ידי יצירת התמונה. בקובץ example.java תמצאו דוגמא לשימוש בממשק הגרפי Painter ובקובץ main.java תמצאו בדיקות לכל המחלקות היוצרות את התמונות כפי שהם מופיעות בעבודה. הגשת העבודה תתבצע אך ורק ב- System.Submission הקבצים להגשה הם:,Snowflake.java,BasicStar.java,Pixel.java,Painter.java.KochSnowflake.java,KochCurve.java,SuperSnowflake.java יש להגיש את הקבצים האלו בלבד )ללא קבצי ה class וכו(. כדי להגיש יש לכווץ אותם לקובץ zip בשם.Ass3.zip שאלות הקשורות לתרגיל יש לשאול אך ורק בפורום.הצוות יענה לשאלות נבחרות בFAQ. הימנעו מהעתקות! ההגשה היא בזוגות. ניתן להגיש גם בקבוצות של 3 או 4 סטודנטים, אך נקודות יופחתו בהתאם! במידה ומוגשות עבודות בנפרד עם קוד זהה או אפילו דומה- זוהי העתקה אשר תדווח לועדת משמעת לאלתר. 1

2 Assignment Description: In this assignment you will create graphic images by using recursive Java methods. Graphic Images Graphic images are drawn in a rectangle. The dimensions of the rectangular are measured in pixels. The rectangular may be width pixels across and height pixels in height. A location in the rectangle is given as a point (X,Y) where both fields are integers. The(0,0) location is at the top-left. Think of graphic images representation as rectangle where each small square is a pixel. The columns of pixels are numbered 0 to width-1 starting at the left. The rows of pixels are numbered 0 to height-1 starting at the top. The Painter Use the provided Painter class (i.e., Painter.java) to open a window frame and draw images. In main.java you will find an example for using the Painter class. The Painter has the following useful methods: void draw(string shape) Creates a frame and displays the shape name. int getframewidth() Returns the width of the frame(integer). int getframeheight() Returns the height of the frame(integer). void setcolor(string c)- Sets the pencil color to c (e.g., red, blue ). void drawline(int x1,int y1,int x2,int y2)- Draws a straight line from point(x1,y1) to point(x2,y2). 2

3 Part I Starry Night (70 Points) In this part you will write recursive methods for drawing stars and snowflakes. 1. Pixel (10 Points) Create the Pixel Class. Create a new class called Pixel.java. The Pixel class should have two fields (i.e., x and y), two constructors and two getter methods. Please see below the structure for this class. public class Pixel{ private int x; private int y; public Pixel(){ x=0; y=0; public Pixel(int x, int y){ // Your code here public int getx(){ // Your code here public int gety(){ // Your code here 3

4 The Fields The field x describes the x-coordinate of the pixel. The field y describes the y-coordinate of the pixel. The Constructor The empty constructor initializes the fields to the pixel (0,0). The second constructor that receives two parameters initializes the class fields from the given arguments. The Getters The two getter methods will help you access the fields of the Pixel class (see example in the main function). 2. BasicStar(20 Points) This program creates the Basic Star. It draws a 6-pointed star. Think of this figure as six lines that originate from a center point. public class BasicStar { public BasicStar(){ public void draw(){ int height = Painter.getFrameHeight()/2; int width = Painter.getFrameWidth()/2; int maxradius = Math.min(height, width)/2; int radius = maxradius/4; Pixel p = new Pixel(height, width); Painter.setColor("blue"); draw(p, radius); public void draw(pixel p, int radius) { // Your code here 4

5 draw() method The width and height are needed to determine the radius of the star that fits in the frame. To draw a symmetrical star, it finds its radius, which is the minimum of the frame s width and height, divided by 2. Let us make the size/4 so that there is room for the rest of the snowflake. The star is drawn in the center of the rectangle. draw(pixel p, int radius) method You will have to implement this method. 1. Each line (of the six) starts at the center, (x, y), and ends at a point on the circle of radius size. The X distance from the center of a point on a circle is radius*cos(θ). The Y distance from the center of a point on a circle is radius *sin(θ) 2. The method finds the six values for theta to find the six endpoints of the lines. The Java trigonometric functions are static methods of the Math. 3. The circle is divided into six pieces. There are two pi radians per Math.Pi circle. One sixth of a circle is The "-" sign is used for endy because y increases in value going down. 3. Snowflake- Recursive star (20 Points) Create a Snowflake class, similar to BasicStar, that draws a snowflake. A snowflake will be drawn by adding another star centered at the tip of each of the six lines, and continuing the recursive process to create a snowflake image. The Fields The Snowflake class has a single field, a BasicStar Object. The Constructor The Snowflake class has an empty constructor that initializes a new BasicStar object. 5

6 draw() method The draw() method in the Snowflake is similar to the draw() method in BasicStar with one exemption, the call in the last line to draw(p, radius) should be replaced by draw(pixel p, int radius, int depth), with depth=4. draw(pixel p, int radius, int depth) method Create a method draw(pixel p, int radius, int depth), and call it from the draw() method. Draw each small star by adding a recursive call to the draw(pixel p, int radius, int depth) method with different parameter values. The new stars need to be smaller than the central star. Thus, the radius of the new stars should be radius/3. The integer depth will represent the number of times left to recursively call the method draw( Pixel p, int radius, int depth ). Add a check in draw( Pixel p, int radius, int depth ) to check if depth is 0. If so, the work is done. As long as depth is greater that 0, the process continues. Decrease depth by 1 with each recursive call. Change the first call to draw( Pixel p, int radius, int depth ) in draw() to have depth=4. 4. Super Snowflake (20 Points) Create a SuperSnowflake class, that draws a super snowflake. The super snowflake image contains the original snowflake and additional circles of snowflakes. There is a central snowflake and around it there are 3 circles, each with 6 snowflakes. Each circle has 6 snowflakes which are 2 times smaller in radius than the previous snowflake's radius (see example below). Each circle has a circleradius which is larger than the previous circleradius by 3*radius (radius is the radius of the snowflake in the previous circle) 6

7 radius circleradius radius radius The Fields The SuperSnowflake class has a single field, a Snowflake Object. The Constructor The SuperSnowflake class has an empty constructor that initializes a new Snowflake object. The draw() method The draw() method in the Snowflake is similar to the draw() method in BasicStar with two exemptions: a. The draw() method should draw the central snowflake. b. The call in the last line to the draw method should be replaced by draw(pixel p, int radius, int depth, int circleradius), with circleradius = 3*radius. The draw(pixel p, int radius, int depth, int circleradius) method This draw method should draw the three circles of snowflakes. Each time this draw method is recursively called another circle of snowflakes is added around the center. 7

8 Part II The Von Koch Curve- Recursion in Fractal Geometry (30 Points) In this part you will write recursive methods for drawing Koch Snowflake. Swedish mathematician Helge von Koch introduced the "Koch curve" in Starting with a line segment, recursively replace the line segment as shown below: 0 1 The single line segment in Step 0, is broken into four equal-length segments in Step 1. This same "rule" is applied an infinite number of times resulting in a figure with an infinite perimeter. Here are the next few steps: For more information and further reading, 8

9 5. The Von KochCurve (15 Points) Create a KochCurve class, which draws the curve shown below. The Fields The KochCurve class has no fields. The Constructor The KochCurve class contains an empty constructor. draw() method Use the following draw() method: public void draw() { int height = Painter.getFrameHeight()/2; int width = Painter.getFrameWidth()/2; Painter.setColor("blue"); Pixel p1 = new Pixel(height/2, width/2); Pixel p2 = new Pixel(height, width); draw(p1,p2, 4); draw(pixel p1, Pixel p2,int depth) method Write a recursive method draw(pixel p1, Pixel p2, int depth) and call it from draw() method. This method accepts the 2 end points of the line, and an integer depth, which is the depth of the recursion. In draw(pixel p1, Pixel p2, int depth ): Find 2 new pixels p 3=(x3,y3) and p4=(x4,y4) which equally divide the segment p1p2 into 3 identical segments. Find a pixel p5=(x5, y5) that creates the equilateral triangle with p3 and p4. Add a recursive call for each of the 4 segments. 9

10 6. The Von Koch Snowflake (15 Points) Create a KochSnowflake class, which draws the KochSnowflake shown in the image below. The Fields The KochSnowflake class contains a single field, a KochCurve object. The Constructor The KochSnowflake class has an empty constructor that initializes a new KochCurve object. draw() method In the draw() method you should first decide on the coordinates of an equilateral triangle. Then, you should call the draw(pixel p1, Pixel p2, int depth) method of KochCurve 3 times, once for each of the triangles sides. public void draw() { int height = Painter.getFrameHeight(); int width = Painter.getFrameWidth(); int side = (int)((height*2/3)/math.cos(math.pi/6)); int x1 = width/2; int y1 = 40; int x2 = 300+side/2; int y2 = 440; int x3 = 300-side/2; int y3 = 440; // Your code here.good Luck!!! 10

3 Dynamic Routing A (RIP and OSPF)

3 Dynamic Routing A (RIP and OSPF) אוניברסיטת בן גוריון בנגב המחלקה להנדסת מערכות תקשורת רשתות תקשורת מחשבים - 2 קורס 37110211 מעבדה בתקשורת מחשבים 3 Dynamic Routing A (RIP and OSPF) בשבוע (29/11/2011) 5 בשבוע (13/12/2011) 7 מעבדה מספר

More information

Clouds, biological growth, and coastlines are

Clouds, biological growth, and coastlines are L A B 11 KOCH SNOWFLAKE Fractals Clouds, biological growth, and coastlines are examples of real-life phenomena that seem too complex to be described using typical mathematical functions or relationships.

More information

Mathematics 350 Section 6.3 Introduction to Fractals

Mathematics 350 Section 6.3 Introduction to Fractals Mathematics 350 Section 6.3 Introduction to Fractals A fractal is generally "a rough or fragmented geometric shape that is self-similar, which means it can be split into parts, each of which is (at least

More information

מבוא למדעי המחשב תרגול 8 רשימה משורשרת כללית, Comparator

מבוא למדעי המחשב תרגול 8 רשימה משורשרת כללית, Comparator מבוא למדעי המחשב 2017 תרגול 8 רשימה משורשרת כללית, Comparator בתרגול היום. LinkedList בניית ההכללה מ- LinkIntList תרגול המבנה ושימושיו ממשקים: Comparator Sorted Linked List ל- LinkedList ע"י שימוש ב- Comparator

More information

CSE 8B Programming Assignments Spring Programming: You will have 5 files all should be located in a dir. named PA3:

CSE 8B Programming Assignments Spring Programming: You will have 5 files all should be located in a dir. named PA3: PROGRAMMING ASSIGNMENT 3: Read Savitch: Chapter 7 Programming: You will have 5 files all should be located in a dir. named PA3: ShapeP3.java PointP3.java CircleP3.java RectangleP3.java TriangleP3.java

More information

Lectures on Challenging Mathematics. Integrated Mathematics 3. Idea Math. Algebra (part 2) Summer Internal Use

Lectures on Challenging Mathematics. Integrated Mathematics 3. Idea Math. Algebra (part 2) Summer Internal Use Lectures on Challenging Mathematics c Copyright 2008 2018 Integrated Mathematics 3 Algebra (part 2) Summer 2018 Zuming Feng Phillips Exeter Academy and IDEA Math zfeng@exeteredu Copyright c 2008 2018 IDEA

More information

תכנות מונחה עצמים משחקים תשע"ו

תכנות מונחה עצמים משחקים תשעו move semantics 1 תכנות מונחה עצמים ופיתוח משחקים תשע"ו סמנטיקת ההעברה semantics( )Move move semantics 2 מטרה האצה של התוכניות, שיפור בביצועים על ידי חסכון בבנייה והעתקה של אובייקטים זמניים move semantics

More information

<The von Koch Snowflake Investigation> properties of fractals is self-similarity. It means that we can magnify them many times and after every

<The von Koch Snowflake Investigation> properties of fractals is self-similarity. It means that we can magnify them many times and after every Jiwon MYP 5 Math Ewa Puzanowska 18th of Oct 2012 About Fractal... In geometry, a fractal is a shape made up of parts that are the same shape as itself and are of

More information

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Array Creation and Initialization. Loop through Arrays

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Array Creation and Initialization. Loop through Arrays מערכים Array: A fixed-length data structure for storing multiple values of the same type תוכנה 1 Example: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5 6 7 odds: 1 3 5 7 9 11 13 15 odds.length

More information

תוכנה 1 3 תרגול מס' מערכים ומבני בקרה

תוכנה 1 3 תרגול מס' מערכים ומבני בקרה תוכנה 1 3 תרגול מס' מערכים ומבני בקרה מערכים Array: A fixed-length data structure for storing multiple values of the same type Example: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5 6 7 odds:

More information

Chapel Hill Math Circle: Symmetry and Fractals

Chapel Hill Math Circle: Symmetry and Fractals Chapel Hill Math Circle: Symmetry and Fractals 10/7/17 1 Introduction This worksheet will explore symmetry. To mathematicians, a symmetry of an object is, roughly speaking, a transformation that does not

More information

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Loop through Arrays. Array Creation and Initialization

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Loop through Arrays. Array Creation and Initialization מערכים תוכנה 1 Array: A fixed-length data structure for storing multiple values of the same type Example from last week: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5 6 7 תרגול 2: מערכים

More information

מבוא לתכנות ב- JAVA תרגול 7

מבוא לתכנות ב- JAVA תרגול 7 מבוא לתכנות ב- JAVA תרגול 7 רקורסיה - הקדמה הגדרה רקורסיבית: חדר הוא מסודר אם צד שמאל שלו מסודר שלו מסודר. וצד ימין שיטת פתרון רקורסיבית: פתרון מופעים פשוטים יותר של בעיה בכדי לפתור את הבעיה המקורית רקורסיה

More information

מצליחה. 1. int fork-bomb() 2. { 3. fork(); 4. fork() && fork() fork(); 5. fork(); printf("bla\n"); 8. return 0; 9. }

מצליחה. 1. int fork-bomb() 2. { 3. fork(); 4. fork() && fork() fork(); 5. fork(); printf(bla\n); 8. return 0; 9. } שאלה : (4 נקודות) א. ב. ג. (5 נקודות) הגדירו את המונח race-condition במדוייק לא להשמיט פרטים. ספקו דוגמא. (5 נקודות) מהו? Monitor נא לספק הגדרה מלאה. ( נקודות) ( נקודות) ציינו כמה תהליכים יווצרו בקוד הבא

More information

Chapter 12: Fractal Geometry The Koch Snowflake and Self-Similarity

Chapter 12: Fractal Geometry The Koch Snowflake and Self-Similarity Chapter 12: Fractal Geometry 12.1 The Koch Snowflake and Self-Similarity Geometric Fractal Our first example of a geometric fractal is a shape known as the Koch snowflake, named after the Swedish mathematician

More information

Topic 7: Algebraic Data Types

Topic 7: Algebraic Data Types Topic 7: Algebraic Data Types 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 5.5, 5.7, 5.8, 5.10, 5.11, 5.12, 5.14 14.4, 14.5, 14.6 14.9, 14.11,

More information

תוכנה 1. תרגול מספר 11: Static vs. Dynamic Binding מחלקות מקוננות Nested Classes

תוכנה 1. תרגול מספר 11: Static vs. Dynamic Binding מחלקות מקוננות Nested Classes תוכנה 1 תרגול מספר 11: Static vs. Dynamic Binding מחלקות מקוננות Nested Classes class Outer { static class NestedButNotInner {... class Inner {... מחלקות מקוננות NESTED CLASSES 2 מחלקה מקוננת Class) )Nested

More information

Fractals. Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna.

Fractals. Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna. Fractals Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna http://www.moreno.marzolla.name/ 2 Geometric Objects Man-made objects are geometrically simple (e.g., rectangles,

More information

LaserJet Enterprise M506

LaserJet Enterprise M506 LaserJet Enterprise M506 M506n M506dn Installation Guide www.hp.com/support/ljm506 1 Select a sturdy, well-ventilated, dust-free area, away from direct sunlight to position the printer. 2 M506n M506dn

More information

Fractals. Materials. Pencil Paper Grid made of triangles

Fractals. Materials. Pencil Paper Grid made of triangles Fractals Overview: Fractals are new on the mathematics scene, however they are in your life every day. Cell phones use fractal antennas, doctors study fractal-based blood flow diagrams to search for cancerous

More information

Number/Computation. addend Any number being added. digit Any one of the ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9

Number/Computation. addend Any number being added. digit Any one of the ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9 14 Number/Computation addend Any number being added algorithm A step-by-step method for computing array A picture that shows a number of items arranged in rows and columns to form a rectangle associative

More information

Solution Notes. COMP 151: Terms Test

Solution Notes. COMP 151: Terms Test Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms

More information

תוכנה 1 סמסטר א' תשע"א

תוכנה 1 סמסטר א' תשעא General Tips on Programming תוכנה 1 סמסטר א' תשע"א תרגול מס' 6 מנשקים, דיאגרמות וביטים * רובי בוים ומתי שמרת Write your code modularly top-down approach Compile + test functionality on the fly Start with

More information

S8.6 Volume. Section 1. Surface area of cuboids: Q1. Work out the surface area of each cuboid shown below:

S8.6 Volume. Section 1. Surface area of cuboids: Q1. Work out the surface area of each cuboid shown below: Things to Learn (Key words, Notation & Formulae) Complete from your notes Radius- Diameter- Surface Area- Volume- Capacity- Prism- Cross-section- Surface area of a prism- Surface area of a cylinder- Volume

More information

כתבו קוד ב- 3 קבצי ה hpp (כתבו כהערה את שם הקובץ מעל) כך שהקוד יהיה תקין ובסגנון טוב. אין חובה

כתבו קוד ב- 3 קבצי ה hpp (כתבו כהערה את שם הקובץ מעל) כך שהקוד יהיה תקין ובסגנון טוב. אין חובה פקולטה: מדעי הטבע מחלקה: מדעי המחשב שם הקורס: מבנה זכרון ושפת ++C קוד הקורס: 7027810 תאריך בחינה: שאלות לדוגמא משך הבחינה: שעתיים שם המרצים: ד"ר אופיר פלא, ד"ר מירי בן ניסן חומר עזר: פתוח שימוש במחשבון:

More information

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions מבוא לתיכנות עם MATLAB 234127 Lecture 5: Boolean logic and Boolean expressions Written by Prof. Reuven Bar-Yehuda, Technion 2013 Based on slides of Dr. Eran Eden, Weizmann 2008 1 >>g = [89 91 80 98]; >>p

More information

תוכנה 1 תרגול 2: מערכים, מבני בקרה ושגיאות

תוכנה 1 תרגול 2: מערכים, מבני בקרה ושגיאות תוכנה 1 תרגול 2: מערכים, מבני בקרה ושגיאות מערכים Array: A fixed-length data structure for storing multiple values of the same type Example: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5

More information

Copyright 2009 Pearson Education, Inc. Chapter 9 Section 7 - Slide 1 AND

Copyright 2009 Pearson Education, Inc. Chapter 9 Section 7 - Slide 1 AND Copyright 2009 Pearson Education, Inc. Chapter 9 Section 7 - Slide 1 AND Chapter 9 Geometry Copyright 2009 Pearson Education, Inc. Chapter 9 Section 7 - Slide 2 WHAT YOU WILL LEARN Transformational geometry,

More information

Answer Key: Three-Dimensional Cross Sections

Answer Key: Three-Dimensional Cross Sections Geometry A Unit Answer Key: Three-Dimensional Cross Sections Name Date Objectives In this lesson, you will: visualize three-dimensional objects from different perspectives be able to create a projection

More information

Geometry. Geometry is the study of shapes and sizes. The next few pages will review some basic geometry facts. Enjoy the short lesson on geometry.

Geometry. Geometry is the study of shapes and sizes. The next few pages will review some basic geometry facts. Enjoy the short lesson on geometry. Geometry Introduction: We live in a world of shapes and figures. Objects around us have length, width and height. They also occupy space. On the job, many times people make decision about what they know

More information

מבוא לתכנות תוכנית שעור מס. 1 1 דר' דרור טובי, המרכז האוניברסיטאי אריאל בשומרון.

מבוא לתכנות תוכנית שעור מס. 1 1 דר' דרור טובי, המרכז האוניברסיטאי אריאל בשומרון. מבוא לתכנות תוכנית ראשונה שעור מס. 1 דרור טובי דר' 1 מבוא לתכנות בשפת ++C C \ שלום!! מרצה ד"ר דרור טובי, drorto@ariel.ac.il שעות קבלה: יום ב, 10-12 טלפון )אריאל( 03 9076547 אתר הקורס: http://www.ariel.ac.il/cs/pf/tdror/courses/cpp

More information

Practice Problems for Geometry from

Practice Problems for Geometry from 1 (T/F): A line has no endpoint. 2 In Figure 2, angle DAE measures x, and angle DEC measures y. What is the degree measure of angle EBC? 3 (T/F): A triangle can have exactly two 60 degree angles. 4 An

More information

קורס גרפיקה ממוחשבת 2008 סמסטר ב' ליאור שפירא 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

קורס גרפיקה ממוחשבת 2008 סמסטר ב' ליאור שפירא 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור קורס גרפיקה ממוחשבת 2008 סמסטר ב' ליאור שפירא 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור מרצה: ליאור שפירא liors@post.tau.ac.il אתר שלי: אתר הקורס: שעת קבלה: יום ג' 14-15

More information

<exp> ::= <define> <cexp> <define> ::= ( define <var-decl> <cexp> ) / DefExp(var:VarDecl, val:cexp)

<exp> ::= <define> <cexp> <define> ::= ( define <var-decl> <cexp> ) / DefExp(var:VarDecl, val:cexp) הנחיות כלליות: תאריך הבוחן: 10.5.2018 שם המרצה: מני אדלר,מיכאל אלחדד, ירון גונן מבחן בקורס: עקרונות שפות תכנות מס' קורס: 202-1-2051 מיועד לתלמידי: מדעי המחשב והנדסת תוכנה שנה: ב' סמסטר: ב' משך הבוחן: 2

More information

הנדסת תוכנה 11. מבוא לתבניות תיכון. se15b-yagel 1

הנדסת תוכנה 11. מבוא לתבניות תיכון. se15b-yagel 1 הנדסת תוכנה 11. מבוא לתבניות תיכון se15b-yagel 1 מה היום? מבוא לתבניות תיכון Design Patterns הדגמה כולל BDD ו- Refactoring לפי הזמן, השלמת בקרת תצורה: Git Workflows בהמשך: עקרונות תיכון מונחה עצמים עבודה

More information

Perimeter, Area, Surface Area, & Volume

Perimeter, Area, Surface Area, & Volume Additional Options: Hide Multiple Choice Answers (Written Response) Open in Microsoft Word (add page breaks and/or edit questions) Generation Date: 11/25/2009 Generated By: Margaret Buell Copyright 2009

More information

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions מבוא לתיכנות עם MATLAB 23427 Lecture 5: Boolean logic and Boolean expressions Written by Prof. Reuven Bar-Yehuda, Technion 203 Based on slides of Dr. Eran Eden, Weizmann 2008 ביטויים לוגיים דוגמא: תקינות

More information

Grade 6 Math Circles. Shapeshifting

Grade 6 Math Circles. Shapeshifting Faculty of Mathematics Waterloo, Ontario N2L 3G1 Plotting Grade 6 Math Circles October 24/25, 2017 Shapeshifting Before we begin today, we are going to quickly go over how to plot points. Centre for Education

More information

Practice Test Unit 8. Note: this page will not be available to you for the test. Memorize it!

Practice Test Unit 8. Note: this page will not be available to you for the test. Memorize it! Geometry Practice Test Unit 8 Name Period: Note: this page will not be available to you for the test. Memorize it! Trigonometric Functions (p. 53 of the Geometry Handbook, version 2.1) SOH CAH TOA sin

More information

תוכנה 1 תרגול 2: מערכים ומבני בקרה

תוכנה 1 תרגול 2: מערכים ומבני בקרה תוכנה 1 תרגול 2: מערכים ומבני בקרה 2 Useful Eclipse Shortcuts Ctrl+1 quick fix for errors, or small refactoring suggestions Ctrl+SPACE code content assist (auto-completion) Auto completion for main create

More information

CISC 1600 Lecture 3.1 Introduction to Processing

CISC 1600 Lecture 3.1 Introduction to Processing CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists

More information

מבוא לתכנות ב- JAVA מעבדה 2

מבוא לתכנות ב- JAVA מעבדה 2 מבוא לתכנות ב- JAVA מעבדה 2 מה בתרגול טיפוסים פרימיטיביים המרות טיפוסים אופרטורים יחסיים ולוגיים משפט if-else בתרגול הקודם טיפוסים פרימיטביים לייצוג מספרים שלמים וממשיים ואופרטורים לפעולות בין מספרים.1

More information

Covering and Surrounding Extensions 1

Covering and Surrounding Extensions 1 Extensions 1 1. The Snowflake Curve. Begin with an equilateral triangle. Let s assume that each side of the triangle has length one. Remove the middle third of each line segment and replace it with two

More information

Math 6, Unit 8 Notes: Geometric Relationships

Math 6, Unit 8 Notes: Geometric Relationships Math 6, Unit 8 Notes: Geometric Relationships Points, Lines and Planes; Line Segments and Rays As we begin any new topic, we have to familiarize ourselves with the language and notation to be successful.

More information

Unit 10 Study Guide: Plane Figures

Unit 10 Study Guide: Plane Figures Unit 10 Study Guide: Plane Figures *Be sure to watch all videos within each lesson* You can find geometric shapes in art. Whether determining the amount of leading or the amount of glass needed for a piece

More information

PLT Miscellaneous Libraries: Reference Manual

PLT Miscellaneous Libraries: Reference Manual PLT Miscellaneous Libraries: Reference Manual PLT (scheme@plt-scheme.org) Version 200 June 2002 Copyright notice Copyright c 1996-2002 PLT Permission to make digital/hard copies and/or distribute this

More information

מבוא לתכנות ב- JAVA מעבדה 3. Ipc161-lab3

מבוא לתכנות ב- JAVA מעבדה 3. Ipc161-lab3 מבוא לתכנות ב- JAVA מעבדה 3 Ipc161-lab3 נושאי התרגול ניפוי שגיאות לולאות בדיקת תרגילים בקורס )השוואת פלטים למול הפתרון המצופה( כיצד להפנות את פלט התוכנית לקובץ טקסט איך להשוות תכנים של שני קבצים בעזרת

More information

הנכות 1 תואיגש םע תודדומתהו תואלול,םי : כרעמ 2 לוגרת

הנכות 1 תואיגש םע תודדומתהו תואלול,םי : כרעמ 2 לוגרת תוכנה 1 תרגול 2: מערכים, לולאות והתמודדות עם שגיאות מערכים מערכים Array: A fixed-length data structure for storing multiple values of the same type Example from last week: An array of odd numbers: Indices

More information

Section 9.5. Tessellations. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Section 9.5. Tessellations. Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 9.5 Tessellations What You Will Learn Tessellations 9.5-2 Tessellations A tessellation (or tiling) is a pattern consisting of the repeated use of the same geometric figures to entirely cover a

More information

Grades 7 & 8, Math Circles 20/21/22 February, D Geometry Solutions

Grades 7 & 8, Math Circles 20/21/22 February, D Geometry Solutions Faculty of Mathematics Waterloo, Ontario NL 3G1 Centre for Education in Mathematics and Computing D Geometry Review Grades 7 & 8, Math Circles 0/1/ February, 018 3D Geometry Solutions Two-dimensional shapes

More information

הנכות 1 תואיגש םע תודדומתהו תואלול,םיכרעמ : לו 2 גרת

הנכות 1 תואיגש םע תודדומתהו תואלול,םיכרעמ : לו 2 גרת תוכנה 1 תרגול 2: מערכים, לולאות והתמודדות עם שגיאות מערכים Array: A fixed-length data structure for storing multiple values of the same type Example from last week: An array of odd numbers: Indices (start

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

The figures below are all prisms. The bases of these prisms are shaded, and the height (altitude) of each prism marked by a dashed line:

The figures below are all prisms. The bases of these prisms are shaded, and the height (altitude) of each prism marked by a dashed line: Prisms Most of the solids you ll see on the Math IIC test are prisms or variations on prisms. A prism is defined as a geometric solid with two congruent bases that lie in parallel planes. You can create

More information

CCBC Math 081 Geometry Section 2.2

CCBC Math 081 Geometry Section 2.2 2.2 Geometry Geometry is the study of shapes and their mathematical properties. In this section, we will learn to calculate the perimeter, area, and volume of a few basic geometric shapes. Perimeter We

More information

The Geometry Template

The Geometry Template Math Message The Geometry Template Answer the following questions about your Geometry Template. DO NOT count the protractors, Percent Circle, and little holes next to the rulers. 1. How many shapes are

More information

CS 2110 Fall Instructions. 1 Installing the code. Homework 4 Paint Program. 0.1 Grading, Partners, Academic Integrity, Help

CS 2110 Fall Instructions. 1 Installing the code. Homework 4 Paint Program. 0.1 Grading, Partners, Academic Integrity, Help CS 2110 Fall 2012 Homework 4 Paint Program Due: Wednesday, 12 November, 11:59PM In this assignment, you will write parts of a simple paint program. Some of the functionality you will implement is: 1. Freehand

More information

Engineering Programming A

Engineering Programming A Engineering Programming A תרגול 5 25.11.2012 מערכים חד-מימדיים )תזכורת( לדוגמא: מערך בשם Arr בגודל 8 שאיבריו מטיפוס int 3 7 5 6 8 1 23 16 0 1 2 3 4 5 6 7 ב - arr[0] ב יושב ערך שהוא המספר השלם 3 arr[1]

More information

Copyright 2013 A+ Interactive MATH (an A+ TutorSoft Inc. company), All Rights Reserved.

Copyright 2013 A+ Interactive MATH (an A+ TutorSoft Inc. company), All Rights Reserved. www.aplustutorsoft.com Page 1 of 20 Dimensions of Shapes Lesson, Worksheet & Solution Guide Release 7 A+ Interactive Math (By A+ TutorSoft, Inc.) Email: info@aplustutorsoft.com www.aplustutorsoft.com www.aplustutorsoft.com

More information

- מבחן. - 4 עבודות ב- JAVA. הגשה בזוגות דרך ה- System Submission

- מבחן. - 4 עבודות ב- JAVA. הגשה בזוגות דרך ה- System Submission 1 - מבחן. - 4 עבודות ב- JAVA 60% 40% הגשה בזוגות דרך ה- System Submission 2 UML Class Diagrams Packages Class Path JAR Files חלק ראשון: חלק שני: 3 An abstraction of software features A structure that singles

More information

Graph Database, think different!

Graph Database, think different! Graph Database, think different! Written by Roni Licher Winter 2014-2015 236363 - Database Systems - Technion Nodes Edges (directed or not) Properties Neo4j and Cypher 4j Graph database (Like SQL server

More information

Aim: How do we find the volume of a figure with a given base? Get Ready: The region R is bounded by the curves. y = x 2 + 1

Aim: How do we find the volume of a figure with a given base? Get Ready: The region R is bounded by the curves. y = x 2 + 1 Get Ready: The region R is bounded by the curves y = x 2 + 1 y = x + 3. a. Find the area of region R. b. The region R is revolved around the horizontal line y = 1. Find the volume of the solid formed.

More information

CISC 1600, Lab 2.1: Processing

CISC 1600, Lab 2.1: Processing CISC 1600, Lab 2.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using Sketchpad, a site for building processing sketches online using processing.js. 1.1. Go to http://cisc1600.sketchpad.cc

More information

CS2 Assignment A1S The Simple Shapes Package

CS2 Assignment A1S The Simple Shapes Package CS2 Assignment A1S The Simple Shapes Package Overview In this project you will create a simple shapes package consisting of three interfaces and three classes. In abstract terms, you will establish classes

More information

Name: Class: Date: 2. I have four vertices. I have four right angles and all my sides are the same length.

Name: Class: Date: 2. I have four vertices. I have four right angles and all my sides are the same length. 1. Circle the right triangles. Use the corner of a piece of paper to check. 2. I have four vertices. I have four right angles and all my sides are the same length. What am I? 3. I have four vertices. All

More information

תוכנה 1 * לא בהכרח בסדר הזה

תוכנה 1 * לא בהכרח בסדר הזה תוכנה 1 תרגול 7: מנשקים, פולימורפיזם ועוד * לא בהכרח בסדר הזה 2 מנשקים מנשקים - תזכורת מנשק )interface( הוא מבנה תחבירי ב- Java המאפשר לחסוך בקוד לקוח. מנשק מכיל כותרות של מתודות )חתימות(. מימוש דיפולטיבי

More information

More About Classes CS 1025 Computer Science Fundamentals I Stephen M. Watt University of Western Ontario

More About Classes CS 1025 Computer Science Fundamentals I Stephen M. Watt University of Western Ontario More About Classes CS 1025 Computer Science Fundamentals I Stephen M. Watt University of Western Ontario The Story So Far... Classes as collections of fields and methods. Methods can access fields, and

More information

Unit 5: Recursive Thinking

Unit 5: Recursive Thinking AP Computer Science Mr. Haytock Unit 5: Recursive Thinking Topics: I. Recursion II. Computational limits III. Recursion in graphics Materials: I. Hein ch. 3.2 II. Rawlins: Towers of Hanoi III. Lewis &

More information

Koch Snowflake Go Figure The Koch Snowflake is a fractal based on a very simple rule.

Koch Snowflake Go Figure  The Koch Snowflake is a fractal based on a very simple rule. Koch Snowflake The Koch Snowflake is a fractal based on a very simple rule. The Rule: Whenever you see a straight line, like the one on the left, divide it in thirds and build an equilateral triangle (one

More information

UNIT 6 MEASUREMENT AND GEOMETRY - PRACTICE

UNIT 6 MEASUREMENT AND GEOMETRY - PRACTICE UNIT 6 MEASUREMENT AND GEOMETRY - PRACTICE UNIT 6 MEASUREMENT AND GEOMETRY - PRACTICE... 1 PERIMETER AND AREA PROBLEMS... Answers... 3 VOLUME AND SURFACE AREA PROBLEMS... 4 Answers... 5 SOME CHALLENGING

More information

ACT Math test Plane Geometry Review

ACT Math test Plane Geometry Review Plane geometry problems account for 14 questions on the ACT Math Test that s almost a quarter of the questions on the Subject Test. If you ve taken high school geometry, you ve probably covered all of

More information

Section A Solids Grade E

Section A Solids Grade E Name: Teacher Assessment Section A Solids Grade E 1. Write down the name of each of these 3-D shapes, (i) (ii) (iii) Answer (i)... (ii)... (iii)... (Total 3 marks) 2. (a) On the isometric grid complete

More information

Summer Packet 7 th into 8 th grade. Name. Integer Operations = 2. (-7)(6)(-4) = = = = 6.

Summer Packet 7 th into 8 th grade. Name. Integer Operations = 2. (-7)(6)(-4) = = = = 6. Integer Operations Name Adding Integers If the signs are the same, add the numbers and keep the sign. 7 + 9 = 16 - + -6 = -8 If the signs are different, find the difference between the numbers and keep

More information

ACT SparkNotes Test Prep: Plane Geometry

ACT SparkNotes Test Prep: Plane Geometry ACT SparkNotes Test Prep: Plane Geometry Plane Geometry Plane geometry problems account for 14 questions on the ACT Math Test that s almost a quarter of the questions on the Subject Test If you ve taken

More information

Student Outcomes. Lesson Notes. Classwork. Opening Exercise (3 minutes)

Student Outcomes. Lesson Notes. Classwork. Opening Exercise (3 minutes) Student Outcomes Students solve problems related to the distance between points that lie on the same horizontal or vertical line Students use the coordinate plane to graph points, line segments and geometric

More information

תרשים המחלקות ותרשים העצמים

תרשים המחלקות ותרשים העצמים 1 תרשים המחלקות ותרשים העצמים חלק שלישי: ניתוח ועיצוב מערכות מידע באמצעות שימוש ב- UML ומתודולוגיית ה- Process )UP( Unified E1 3 E2 2 Outline UML Introduction Class Diagram Class Association Self association

More information

Measuring Triangles. 1 cm 2. 1 cm. 1 cm

Measuring Triangles. 1 cm 2. 1 cm. 1 cm 3 Measuring Triangles You can find the area of a figure by drawing it on a grid (or covering it with a transparent grid) and counting squares, but this can be very time consuming. In Investigation 1, you

More information

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM Introduction to the Assignment In this assignment, you will get practice with recursion. There are three parts

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 20, 2014 Abstract

More information

Grades 7 & 8, Math Circles 20/21/22 February, D Geometry

Grades 7 & 8, Math Circles 20/21/22 February, D Geometry Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing 2D Geometry Review Grades 7 & 8, Math Circles 20/21/22 February, 2018 3D Geometry Two-dimensional shapes

More information

Generating Vectors Overview

Generating Vectors Overview Generating Vectors Overview Vectors are mathematically defined shapes consisting of a series of points (nodes), which are connected by lines, arcs or curves (spans) to form the overall shape. Vectors can

More information

הנכות 1 םוכיס לוגרת 14 1

הנכות 1 םוכיס לוגרת 14 1 תוכנה 1 סיכום תרגול 14 1 קצת על מנשקים מנשק יכול להרחיב יותר ממנשק אחד שירותים במנשק הם תמיד מופשטים וציבוריים public interface MyInterface { public abstract int foo1(int i); int foo2(int i); The modifiers

More information

MPM1D Page 1 of 6. length, width, thickness, area, volume, flatness, infinite extent, contains infinite number of points. A part of a with endpoints.

MPM1D Page 1 of 6. length, width, thickness, area, volume, flatness, infinite extent, contains infinite number of points. A part of a with endpoints. MPM1D Page 1 of 6 Unit 5 Lesson 1 (Review) Date: Review of Polygons Activity 1: Watch: http://www.mathsisfun.com/geometry/dimensions.html OBJECT Point # of DIMENSIONS CHARACTERISTICS location, length,

More information

הקלחמ ה תמרב ת ונ וכ ת (static members ) יליזרב דהוא Java תפשב ם דקת מ תונכת ביבא ל ת תטיסרבינוא

הקלחמ ה תמרב ת ונ וכ ת (static members ) יליזרב דהוא Java תפשב ם דקת מ תונכת ביבא ל ת תטיסרבינוא ת כו נו ת ברמת ה מחלקה (static members) אוהד ברזילי תכנות מ תקד ם בשפת Java אוניברסיטת ת ל אביב static keyword שדות המוגדרים כ static מציינים כי הם מוגדרים ברמת המחלקה ולא ברמת עצם כל העצמים של אותה מחלקה

More information

Recommended Group Brainstorm (NO computers during this time)

Recommended Group Brainstorm (NO computers during this time) Recommended Group Brainstorm (NO computers during this time) Good programmers think before they begin coding. Part I of this assignment involves brainstorming with a group of peers with no computers to

More information

תוכנה 1. תרגול 1: סביבת העבודה ומבוא ל- Java

תוכנה 1. תרגול 1: סביבת העבודה ומבוא ל- Java תוכנה 1 תרגול 1: סביבת העבודה ומבוא ל- Java 1 מנהלות אתר הקורס: http://courses.cs.tau.ac.il/software1/1718b/ מתרגלים: ברית יונגמן )שעת קבלה: רביעי ב- 9:00 בתיאום מראש( שי גרשטיין )שעת קבלה: רביעי ב- 18:00,

More information

Extra Practice 1. Name Date. Lesson 1: Exploring Triangles

Extra Practice 1. Name Date. Lesson 1: Exploring Triangles Master 6.36 Extra Practice 1 Lesson 1: Exploring Triangles 1. Draw 3 different triangles. Measure and label the side lengths. Name each triangle as equilateral, isosceles, or scalene. 2. Name each triangle

More information

Area rectangles & parallelograms

Area rectangles & parallelograms Area rectangles & parallelograms Rectangles One way to describe the size of a room is by naming its dimensions. So a room that measures 12 ft. by 10 ft. could be described by saying its a 12 by 10 foot

More information

מחרוזות ב Java ותכנות מונחה בדיקות )Test Driven Development(

מחרוזות ב Java ותכנות מונחה בדיקות )Test Driven Development( מחרוזות ב Java ותכנות מונחה בדיקות )Test Driven Development( תוכנה 1 תרגול 8 String Immutability Strings are constants String s = " Tea "; s = s.trim(); s = s.replace('t', 'S'); s 1 2 3 " Tea " "Tea" "Sea"

More information

Geometry. Oklahoma Math Day INSTRUCTIONS:

Geometry. Oklahoma Math Day INSTRUCTIONS: Oklahoma Math Day November 16, 016 Geometry INSTRUCTIONS: 1. Do not begin the test until told to do so.. Calculators are not permitted. 3. Be sure to enter your name and high school code on the answer

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 21, 2013 Abstract

More information

2. A circle is inscribed in a square of diagonal length 12 inches. What is the area of the circle?

2. A circle is inscribed in a square of diagonal length 12 inches. What is the area of the circle? March 24, 2011 1. When a square is cut into two congruent rectangles, each has a perimeter of P feet. When the square is cut into three congruent rectangles, each has a perimeter of P 6 feet. Determine

More information

Unit 1, Lesson 11: Polygons

Unit 1, Lesson 11: Polygons Unit 1, Lesson 11: Polygons Lesson Goals Understand and explain that one can find the area of any polygon by decomposing and rearranging it into rectangles and triangles. Understand the defining characteristics

More information

Area and Perimeter Name: Date:

Area and Perimeter Name: Date: Area and Perimeter Name: Date: RECTANGLE: PARALLELOGRAM: TRIANGLE: TRAPEZOID: PERIMETER: 1. Plot the following points on the graph above: R(-3, 2), T(-3, 7), W(-9, 2), S(-9, 7). Now connect the points.

More information

Someone else might choose to describe the closet by determining how many square tiles it would take to cover the floor. 6 ft.

Someone else might choose to describe the closet by determining how many square tiles it would take to cover the floor. 6 ft. Areas Rectangles One way to describe the size of a room is by naming its dimensions. So a room that measures 12 ft. by 10 ft. could be described by saying its a 12 by 10 foot room. In fact, that is how

More information

Moore Catholic High School Math Department

Moore Catholic High School Math Department Moore Catholic High School Math Department Geometry Vocabulary The following is a list of terms and properties which are necessary for success in a Geometry class. You will be tested on these terms during

More information

CISC 1600, Lab 3.1: Processing

CISC 1600, Lab 3.1: Processing CISC 1600, Lab 3.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using OpenProcessing, a site for building processing sketches online using processing.js. 1.1. Go to https://www.openprocessing.org/class/57767/

More information

Recalling Quadrilaterals

Recalling Quadrilaterals Recalling Quadrilaterals Play Area Lesson 23-1 Recalling Quadrilaterals Learning Targets: Define and classify quadrilaterals based on their properties. Use properties of quadrilaterals to determine missing

More information

The age of the post PC

The age of the post PC The age of the post PC Mobile is the new face of engagement Apps Are Not Just For Fun And Games; Employees Use Them To Get Work Done Most Workers Pay For Their Own Tablets Most wanted platform by developers

More information

Euclid s Muse Directions

Euclid s Muse Directions Euclid s Muse Directions First: Draw and label three columns on your chart paper as shown below. Name Picture Definition Tape your cards to the chart paper (3 per page) in the appropriate columns. Name

More information

Methods in Mathematics

Methods in Mathematics Write your name here Surname Other names Pearson Edexcel GCSE Centre Number Candidate Number Methods in Mathematics Unit 2: Methods 2 For Approved Pilot Centres ONLY Foundation Tier Wednesday 12 November

More information